﻿<Window x:Class="PatientAdmissionWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:lib="clr-namespace:HMSLibrary;assembly=HMSLibrary"
    xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
    SizeToContent="WidthAndHeight" WindowStyle="None" AllowsTransparency="True" Icon="/Horizon.HMS;component/Images/POSIcon.ico"
    xmlns:local="clr-namespace:Horizon.HMS" WindowStartupLocation="CenterScreen" Background="Transparent" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit">
    <Border Background="White" BorderBrush="Navy" BorderThickness="2" CornerRadius="10" Width="650" Height="470">
        <Grid Margin="10" Background="{StaticResource WindowBackground}">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Margin="20,2" FontSize="16" FontWeight="SemiBold" Foreground="{StaticResource TextLabelColor}">
             <Run Text="HMS(" />
            <Run Text="Your management partner..." FontSize="10" FontStyle="Italic"/>
            <Run Text=")" />
            <Run Text=" :: "/>
            <Run Text="Patient Admission"/>
            </TextBlock>
            <Button Grid.Column="2" Style="{DynamicResource CloseButtonStyle}" Width="11.195" Content="Button" x:Name="CloseButton" Cursor="Hand" HorizontalAlignment="Right" Margin="0,5.583,7.468,0" VerticalAlignment="Top" Height="12.77"/>
            <Button Grid.Column="2" Style="{DynamicResource MinimizeButtonStyle}" Width="12.402" Content="Button" x:Name="MinimizeButton" Cursor="Hand" HorizontalAlignment="Right" Margin="0,4.733,24.606,0" VerticalAlignment="Top" Height="13.537"/>
            <Path Data="M18,115 L616,115" Fill="#FFF4F4F5" Height="1" Margin="5" Width="600" Stretch="Fill" Stroke="White" Grid.Row="1" Grid.ColumnSpan="2"/>
            <Grid Grid.Row="2" Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                    <local:PatientSearchControl x:Name="PatientControl"/>
                <TabControl Name="MainStack" Grid.Row="1" Width="500" Height="350">
                    <TabItem Header="Patient Admission" Name="PatientAdmissionTabItem">
                    <Grid Background="{StaticResource WindowBackground}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="28"/>
                            <RowDefinition Height="100"/>
                            <RowDefinition Height="28"/>
                            <RowDefinition Height="28"/>
                            <RowDefinition Height="28"/>
                            <RowDefinition Height="100"/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="Adminssion Date:" Style="{StaticResource TextBlockStyle}"/>
                        <DatePicker Grid.Column="1" Height="28" Name="AdminssionDateDatePicker" Width="200" HorizontalAlignment="Left"/>
                            <TextBlock Text="Complaints:" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
                        <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
                                <extToolkit:WatermarkTextBox Watermark="Complaints" Width="330" Name="ComplaintsTextBox" Margin="2" AcceptsReturn="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto" />
                                <Button Content="..." Height="28" Width="30" Margin="2" Name="ComplaintsButton"/>
                        </StackPanel>
                        <TextBlock Text="Ward:" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
                        <ComboBox Grid.Column="1" Grid.Row="2" Margin="2" Name="WardComboBox" DisplayMemberPath="WardNo" SelectedValuePath="ID"/>
                        <TextBlock Text="Department:" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
                        <ComboBox Grid.Column="1" Grid.Row="3" Margin="2" Name="DepartmentComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
                        <TextBlock Text="Room:" Grid.Row="4" Style="{StaticResource TextBlockStyle}"/>
                        <ComboBox Grid.Column="1" Grid.Row="4" Margin="2" Name="RoomComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
                        <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Remarks" Height="100" Grid.Row="5" Name="AdminssionRemarksTextBox" Margin="2"  AcceptsReturn="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto"/>
                        <TextBlock Text="Remarks:" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
                    </Grid>
                </TabItem>
                    <TabItem Header="Advance Payments" Name="AdvancePaymentsTabItem">
                        <Grid Background="{StaticResource WindowBackground}" Margin="2" Name="PaymentDetailsGrid">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="28"/>
                                    <RowDefinition Height="28"/>
                                    <RowDefinition Height="28"/>
                                    <RowDefinition Height="28"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="Payment Mode:"  Style="{StaticResource TextBlockStyle}"/>
                                <ComboBox Margin="2" Grid.Column="1" Width="250" HorizontalAlignment="Left" Name="PaymentModeComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
                                <TextBlock Text="Cheque/CC No:" Grid.Row="1"  Style="{StaticResource TextBlockStyle}"/>
                                <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
                                    <extToolkit:WatermarkTextBox Watermark="Cheque/CC No" Width="170" Margin="2" Name="ChequeCCNoTextBox" MaxLength="16" />
                                    <TextBlock Text="Date:" Style="{StaticResource TextBlockStyle}"/>
                                    <DatePicker Height="28" Name="ChqDatePicker" Width="110" Margin="2"/>
                                </StackPanel>
                                <TextBlock Text="Bank:" Style="{StaticResource TextBlockStyle}" Grid.Row="2"/>
                                <ComboBox Margin="2" Grid.Row="2" Grid.Column="1" Width="250" HorizontalAlignment="Left" Name="BankComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
                                <TextBlock Text="Advance Received:" Grid.Row="3"  Style="{StaticResource TextBlockStyle}"/>
                                <StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
                                    <extToolkit:WatermarkTextBox Watermark="Advance Received" Width="100" Margin="2" HorizontalAlignment="Left" Name="AdvReceivedTextBox"/>
                                    <TextBlock Text="Receipt No:" Style="{StaticResource TextBlockStyle}" />
                                    <TextBlock Name="ReceiptNoTextBlock" Style="{StaticResource TextBlockStyle}" />
                                <Button Height="25" Margin="2" Name="SaveButton" IsEnabled="False" ToolTip="Save" Cursor="Hand">
                                        <Button.Template>
                                            <ControlTemplate>
                                                <Image Source="/Horizon.HMS;component/Images/clean.png"/>
                                            </ControlTemplate>
                                        </Button.Template>
                                    </Button>
                                    <Button Height="25" Margin="2" IsEnabled="False" Name="PrintButton" ToolTip="Print" Cursor="Hand" Visibility="Collapsed">
                                        <Button.Template>
                                            <ControlTemplate>
                                                <Image Source="/Horizon.HMS;component/Images/printer.png" />
                                            </ControlTemplate>
                                        </Button.Template>
                                    </Button>
                                </StackPanel>
                                <my:DataGrid Grid.Row="4" Grid.ColumnSpan="2" Margin="5" Name="PaymentDataGrid" Style="{StaticResource SerachDataGridStyle}" MaxWidth="470">
                                    <my:DataGrid.Columns>
                                        <my:DataGridTemplateColumn Width="20">
                                            <my:DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Template="{StaticResource DeleteButtonTemp}" Name="DeleteButton" Click="DeleteButton_Click"/>
                                                </DataTemplate>
                                            </my:DataGridTemplateColumn.CellTemplate>
                                        </my:DataGridTemplateColumn>
                                        <my:DataGridTextColumn Header="Receipt No" Binding="{Binding PayID}"/>
                                        <my:DataGridTextColumn Header="Pay Mode" Binding="{Binding PayModeName}"/>
                                        <my:DataGridTextColumn Header="Cheque/CC No" Binding="{Binding Cheque_CC_No}"/>
                                        <my:DataGridTextColumn Header="ChequeDate" Binding="{Binding ChequeDate, StringFormat={}{0:dd/MM/yyyy}}"/>
                                        <my:DataGridTextColumn Header="Bank" Binding="{Binding BankName}"/>
                                        <my:DataGridTextColumn Header="Amount" Binding="{Binding Amount}"/>
                                    </my:DataGrid.Columns>
                                </my:DataGrid>
                            </Grid>
                    </TabItem>
                </TabControl>
            </Grid>
            <StackPanel Name="FindStackPanel" Grid.Row="2" Margin="5" Visibility="Collapsed">
                <lib:SearchBox x:Name="Ctrl" HorizontalAlignment="Right" Margin="10,5"
					Width="249" Height="22" Mode="{Binding SelectedValue.Content, ElementName=SearchMode}"
					Prompt="Search text" ToolTip="Type to search the current view">
                    <lib:SearchBox.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Option 1" IsCheckable="True"/>
                            <MenuItem Header="Option 2" IsCheckable="True"/>
                        </ContextMenu>
                    </lib:SearchBox.ContextMenu>
                    <lib:SearchBox.LayoutTransform>
                        <ScaleTransform ScaleX="{Binding Value, ElementName=Scaler}" 
																						ScaleY="{Binding Value, ElementName=Scaler}"/>
                    </lib:SearchBox.LayoutTransform>
                </lib:SearchBox>
                <extToolkit:BusyIndicator Name="BusyIndicator1" Grid.ColumnSpan="3"/>
                <ScrollViewer Margin="5" MaxHeight="630">
                    <my:DataGrid Grid.Row="2" Name="SearchDataGrid" Style="{StaticResource SerachDataGridStyle}">
                        <my:DataGrid.Columns>
                            <my:DataGridTemplateColumn Width="20">
                                <my:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Template="{StaticResource DeleteButtonTemp}" Name="DeleteButton" Click="DeleteButton_Click"/>
                                    </DataTemplate>
                                </my:DataGridTemplateColumn.CellTemplate>
                            </my:DataGridTemplateColumn>
                            <my:DataGridTextColumn Header="First Name" Binding="{Binding FirstName}" />
                            <my:DataGridTextColumn Header="Last Name" Binding="{Binding LastName}" />
                            <my:DataGridTextColumn Header="Sur Name" Binding="{Binding SurName}" />
                            <my:DataGridTextColumn Header="Gender" Binding="{Binding Gender}" />
                            <my:DataGridTextColumn Header="Address" Binding="{Binding Address}" />
                            <my:DataGridTextColumn Header="Tel. No" Binding="{Binding TelephoneNo}" />
                            <my:DataGridTextColumn Header="Mobile No" Binding="{Binding MobileNo}" />
                            <my:DataGridTextColumn Header="Contact Person" Binding="{Binding ContactPerson}" />
                            <my:DataGridTextColumn Header="Adminssion Date" Binding="{Binding AdminssionDate, StringFormat={}{0:dd/MM/yyyy}}" />
                            <my:DataGridTextColumn Header="Age" Binding="{Binding Age}" />
                            <my:DataGridTextColumn Header="Complaints" Binding="{Binding Complaints}" />
                            <my:DataGridTextColumn Header="Room" Binding="{Binding Room}" />
                        </my:DataGrid.Columns>
                    </my:DataGrid>
                </ScrollViewer>
            </StackPanel>
            <local:SidePanel Grid.Row="2" x:Name="TransSidePanel" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.ColumnSpan="2"/>
        </Grid>
    </Border>
</Window>
